(read_avail_input): Write loop as a do-while.
authorKarl Heuer <kwzh@gnu.org>
Tue, 19 Apr 1994 05:52:58 +0000 (05:52 +0000)
committerKarl Heuer <kwzh@gnu.org>
Tue, 19 Apr 1994 05:52:58 +0000 (05:52 +0000)
src/keyboard.c

index 434d019c6e04e935426e1d02a16b7223b8ca89d9..affd373655bb551bc1e06f212f30d6f6ded14f5d 100644 (file)
@@ -3339,7 +3339,7 @@ read_avail_input (expected)
 
       /* Now read; for one reason or another, this will not block.
         NREAD is set to the number of chars read.  */
-      while (1)
+      do
        {
 #ifdef MSDOS
          cbuf[0] = dos_keyread();
@@ -3356,17 +3356,15 @@ read_avail_input (expected)
            kill (0, SIGHUP);
 #endif
          /* Retry the read if it was interrupted.  */
-         if (nread >= 0
-             || ! (errno == EAGAIN 
+       }
+      while (nread < 0 && (errno == EAGAIN 
 #ifdef EFAULT
-                   || errno == EFAULT
+                          || errno == EFAULT
 #endif
 #ifdef EBADSLT
-                   || errno == EBADSLT
+                          || errno == EBADSLT
 #endif
-                   ))
-           break;
-       }
+                          ));
 
 #ifndef FIONREAD
 #if defined (USG) || defined (DGUX)